<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

         div{
                margin-top: 100px;
                text-align: center;
         }
    </style>
</head>
<body>
    <div>
                <button id="start">开始</button>
                <button id="end">结束</button>
                <h1 id="txt">开始抽奖吧</h1>
            
           </div>

           <script>

            var tag=document.getElementById('txt');
            var start=document.getElementById('start');
            var end=document.getElementById('end');
            var timer;
            var list=['wawa','poopo','dddd','mmmm','wywywy','wwwww',];
            console.log(list[0]);
            console.log(list.length);
            start.onclick=function(){
                clearInterval(timer);
                timer=setInterval(function(){
                    var n=parseInt(Math.random()*list.length);
                    tag.innerHTML=list[n]
                },100)
            }
            end.onclick=function(){
                clearInterval(timer);
            }
        </script>
</body>
</html>